//
//  YDAAccountSettingCell.m
//  siyanone
//
//  Created by LK-IOS on 2018/3/26.
//  Copyright © 2018年 LK-News. All rights reserved.
//

#import "YDAAccountSettingCell.h"

@interface YDAAccountSettingCell()

//分割线
@property (nonatomic , weak) UIView *lineView;
//图片
@property (nonatomic , weak) UIImageView *cateImage;
//类别文字
@property (nonatomic , weak) UILabel *cateLabel;


@end

@implementation YDAAccountSettingCell


-(void)setCateString:(NSString *)cateString
{
    _cateString = cateString;
    self.cateLabel.text = cateString;
}
-(void)setImageName:(NSString *)imageName
{
    _imageName = imageName;
    self.cateImage.image = [UIImage imageNamed:imageName];
}
-(void)setIsSet:(BOOL)isSet
{
    _isSet = isSet;
    if (isSet) {
        self.setStatus.text = @"已设置";
    }else{
        self.setStatus.text = @"未设置";
    }
}

-(void)setBankCount:(NSString *)bankCount
{
    if ([bankCount integerValue] == 0) {
        self.setStatus.text = @"未设置";
    }else
    {
        self.setStatus.text = bankCount;
    }
    
}

+ (instancetype)cellWithTableView:(UITableView *)tableView
{
    static NSString *aAccountSettingCell = @"YDAAccountSettingCell";
    YDAAccountSettingCell *cell = [tableView dequeueReusableCellWithIdentifier:aAccountSettingCell];
    if (cell == nil) {
        cell = [[YDAAccountSettingCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:aAccountSettingCell];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return cell;
}



-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.contentView.backgroundColor = [UIColor whiteColor];
        self.backgroundColor = [UIColor whiteColor];
        [self lineView];
        [self cateImage];
        [self cateLabel];
        [self accImage];
        [self setStatus];
        [self phoneLabel];
        
        
    }
    return self;
}
-(UIView *)lineView
{
    if (_lineView == nil) {
        UIView *lineView = [[UIView alloc] init];
        [self.contentView addSubview:lineView];
        lineView.backgroundColor = NumberColor(247, 247, 247);
        [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.right.bottom.equalTo(self);
            make.height.equalTo(@1);
        }];
        
        _lineView = lineView;
    }
    return _lineView;
}
-(UIImageView *)cateImage
{
    if (_cateImage == nil) {
        UIImageView *cateImage = [[UIImageView alloc] init];
        [self.contentView addSubview:cateImage];
        cateImage.image = [UIImage imageNamed:@""];
        cateImage.contentMode = UIViewContentModeScaleAspectFill;
        [cateImage mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.left.equalTo(self).offset(rate375(25));
        }];
        
        _cateImage = cateImage;
    }
    return _cateImage;
}
-(UILabel *)cateLabel
{
    if (_cateLabel == nil) {
        UILabel *cateLabel = [[UILabel alloc] init];
        [self.contentView addSubview:cateLabel];
        cateLabel.textColor = NumberColor(129, 128, 129);
        cateLabel.font = [UIFont systemFontOfSize:font14ScreenWRate * LKScreenW];
        cateLabel.textAlignment = NSTextAlignmentLeft;
        cateLabel.text = @"优股网";
        [cateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(self.cateImage.mas_right).offset(rate375(11));
            make.centerY.equalTo(self);
        }];
        _cateLabel = cateLabel;
    }
    return _cateLabel;
}

-(UIImageView *)accImage
{
    if (_accImage == nil) {
        UIImageView *accImage = [[UIImageView alloc] init];
        [self.contentView addSubview:accImage];
        accImage.image = [UIImage imageNamed:@"wode-gd-grey"];
        [accImage mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.equalTo(self);
            make.right.equalTo(self).offset(-rate375(28));
        }];
        _accImage = accImage;
    }
    return _accImage;
}

-(UILabel *)setStatus
{
    if (_setStatus == nil) {
        UILabel *setStatus = [[UILabel alloc] init];
        [self.contentView addSubview:setStatus];
        setStatus.textColor = NumberColor(129, 128, 129);
        setStatus.font = [UIFont systemFontOfSize:font14ScreenWRate * LKScreenW];
        setStatus.textAlignment = NSTextAlignmentRight;
        setStatus.text = @"未设置";
        [setStatus mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self).offset(-rate375(46));
            make.centerY.equalTo(self);
        }];
        _setStatus = setStatus;
    }
    return _setStatus;
}
-(UILabel *)phoneLabel
{
    if (_phoneLabel == nil) {
        UILabel *phoneLabel = [[UILabel alloc] init];
        [self.contentView addSubview:phoneLabel];
        phoneLabel.textColor = [UIColor colorWithHexString:dark];
        phoneLabel.font = [UIFont systemFontOfSize:font14ScreenWRate * LKScreenW];
        phoneLabel.textAlignment = NSTextAlignmentRight;
        phoneLabel.text = @"138****3838";
        [phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.right.equalTo(self).offset(-rate375(25));
            make.centerY.equalTo(self);
        }];
        _phoneLabel = phoneLabel;
    }
    return _phoneLabel;
}



@end
